package com.hx.setting.dao.imp;

import com.hx.setting.dao.VirtualDeleteDao;
import com.hx.setting.dao.imp.JdbcBaseDaoImp;
import com.hx.setting.entity.Entity;
import com.hx.setting.model.*;
import java.io.Serializable;
import java.util.List;

/**
 * 虚拟删除实现类,禁止使用物理删除.
 * Generate Date : 2014-03-16
 * Generate Version : v3.0
 * Generate Name : Honey v3.1 Test
 * Generate User : THINK
 * JDK Version : 1.5
 */
@SuppressWarnings("unchecked")
public abstract class VirtualDeleteDaoImp<E extends Entity, PK extends Serializable> extends JdbcBaseDaoImp<E, PK> implements VirtualDeleteDao<E, PK>
{

	protected abstract int virtualDelete(String condtion, Object ...params);

	@Override
	public int virtualDeleteByPrimaryKey(PK pk)
	{
		return virtualDelete( getFieldPrimaryKeyName() + "=?" ,pk );
	}

	@Override
	public int delete(PK pk)
	{
		//覆盖父类物理删除,禁止使用物理删除.
		return virtualDeleteByPrimaryKey( pk );
		//;
	}

	@Override
	public int deleteByPrimaryKey(PK pk)
	{
		//覆盖父类物理删除,禁止使用物理删除.
		return virtualDeleteByPrimaryKey( pk );
		//;
	}

	@Override
	public final int virtualDeleteByDynamic(Condition<? extends GeneratedCriteria> search)
	{
		Object[] build = make( search );
		return virtualDelete( (String) build[0] ,(Object[]) build[1] );
	}

	@Override
	public final int deleteByDynamic(Condition<? extends GeneratedCriteria> search)
	{
		//覆盖父类物理删除,禁止使用物理删除.
		return this.virtualDeleteByDynamic( search );
		//;
	}

	@Override
	public List<E> selectVirtualDelete()
	{
		return null;
	}

	@Override
	public List<E> selectVirtualDelete(Page page)
	{
		return null;
	}
}
/* Honey v3.1 Test - version:1 - OriginalChecksum:Bc3efd8215825c92ef859504340a1c6f9 (do not edit this line) */
